<?xml version="1.0" encoding="UTF-8" ?>

<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/templates/application.xhtml">
                
                
	<ui:define name="title"><h:outputText value="Students"/></ui:define>
	
	
	<ui:define name="header">
		<h4><h:outputText value="Students"/></h4>

	</ui:define>
	
	
	<ui:define name="content">
	
		<h:form>
			
		    <p:dataTable var="student" value="#{dtStudentsView.students}" 
		    			 widgetVar="studentsTable" rows="10"
                         paginator="true"
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="5,10,15"
		                 emptyMessage="No student found with given criteria" 
		                 filteredValue="#{dtStudentsView.filteredStudents}">

				<f:facet name="header">
		            <p:outputPanel style="margin:5px 0;">
		                <h:outputText value="Search all fields:"/>
		                <p:inputText id="globalFilter" onkeyup="PF('studentsTable').filter()" style="width:200px;" placeholder="Enter keyword"/>
		            </p:outputPanel>
		        </f:facet>
 
		        <p:column filter="true" filterBy="#{student.id}" headerText="Id" sortBy="#{student.id}">
		            <h:outputText value="#{student.id}" />
		        </p:column>
		 
		        <p:column filter="true" filterBy="#{student.firstName}" headerText="#{Message['label.firstname']}" sortBy="#{student.firstName}" filterMatchMode="contains">
		            <h:outputText value="#{student.firstName}" />
		        </p:column>
		        
   		        <p:column filterBy="#{student.lastName}" headerText="#{Message['label.lastname']}" sortBy="#{student.lastName}" filterMatchMode="contains">
		            <h:outputText value="#{student.lastName}" />
		        </p:column>
		        
		      	<p:column filterBy="#{student.address}" headerText="#{Message['label.address']}" sortBy="#{student.address}" filterMatchMode="contains">
		            <h:outputText value="#{student.address}" />
		        </p:column>
		        
		        <p:column filterBy="#{student.birthday}" headerText="#{Message['label.birthday']}" sortBy="#{student.address}" filterMatchMode="contains">
		            <h:outputText value="#{student.birthday}" />
		        </p:column>
		      
		    </p:dataTable>
		</h:form>
		
		
		
		
	</ui:define>
                
                
</ui:composition>
